<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:setLocale value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
	<fmt:setBundle basename="i18n.itilbase"/>
	<c:set var="lang" value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="styles/index.css" />
<script type="text/javascript" src="scripts/jquery/jquery-1.4.2.min.js"></script>
<script src="web/js/common.js"></script>
<meta charset="UTF-8">
<title><fmt:message key="i18n.findPassword"/>-<fmt:message key="i18n.title"/> </title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1" />

<script type="text/javascript">

function fpUpdatePassword1(){
	if($('#fp1_newPassword').val()==''){
		alert('Login password can not be empty(登录密码不能为空)!');
		$('#fp1_newPassword').focus();
		return false;
	}
	if($('#fp1_newPassword').val()!=$('#fp1_cofimPassword').val()){
		alert('Login password two times the input is not correct(登录密码两次输入不正确)!');
		$('#fp1_cofimPassword').focus();
		return false;
	}
	if($('#fp2_newPassword').val()==''){
		alert('Trading password can not be empty(交易密码不能为空)!');
		$('#fp2_newPassword').focus();
		return false;
	}
	if($('#fp2_newPassword').val()!=$('#fp2_cofimPassword').val()){
		alert('Trading password two times the input is not correct(交易密码两次输入不正确)!');
		$('#fp2_cofimPassword').focus();
		return false;
	}
	var frm=$("#my-updatePasswordform").serialize();
	$.post("registerUser!updateUserPassword.action",frm,function(data){
		if(data){
			alert("Successful in changing the password, please login(密码修改成功，请登录)！");
			window.location="login.jsp";
		}else{
			alert("Modify the password failed(密码修改失败)！");
		}
	});
	
}

$(function(){
	document.onkeydown = function(evt){
		var evt = window.event?window.event:evt;
		if(evt.keyCode==13){
			fpUpdatePassword1();
		}
	}
	$("#fptable").find("tr").addClass("color1");
	$("#fptable").find("tr:odd").addClass("color2");
});
</script>
</head>
<body style="height:800px">
<jsp:include page="top.jsp"></jsp:include>
<!-- 主体内容 -->
<div class="mainWrap">
	<div class="mwCurrent"><fmt:message key="i18n.yourlocation"/>：<fmt:message key="i18n.findPassword"/>   &gt;  <fmt:message key="i18n.updatePassword"/></div>
	<div class="listWrap">
           <div class="liTitle">
               <span></span>
               <div class="litit"><h3><fmt:message key="i18n.updatePassword"/></h3></div>
               <strong></strong>
           </div>
           <div class="listCont">
           <form id="my-updatePasswordform">
        		<input type="hidden" id="fp1_loginName" name="registerUserDTO.loginName" value="${param.userName }" />
        		<input type="hidden" id="fp1_loginName" name="registerUserDTO.emailContent" value="${param.emailContent }" />
	        	<table id="fptable" style="width: 100%">
	        		<tr>
	        			<td align="left" colspan="2"><span style="font-weight: 600;font-size: 15px;"><fmt:message key="i18n.loginPassword"/>：</span></td>
	        		</tr>
	   
	        		<tr>
	        			<td align="right"><fmt:message key="i18n.newPassword"/>：</td>
	        			<td align="left"><input type="password" name="registerUserDTO.password1" id="fp1_newPassword"  /></td>
	        		</tr>
	        		<tr>
	        			<td align="left" colspan="2"></td>
	        		</tr>
	        		<tr>
	        			<td align="right"><fmt:message key="i18n.cofimPassword"/>：</td>
	        			<td align="left"><input type="password" id="fp1_cofimPassword"  />
	        			
	        			</td>
	        		</tr>
		        	<tr>
	        			<td align="left" colspan="2"><span style="font-weight: 600;font-size: 15px;"><fmt:message key="i18n.tradePassword"/>：</span></td>
	        		</tr>
	   
	        		<tr>
	        			<td align="right"><fmt:message key="i18n.newPassword"/>：</td>
	        			<td align="left"><input type="password" name="registerUserDTO.password2" id="fp2_newPassword"  /></td>
	        		</tr>
	        		<tr>
	        			<td align="left" colspan="2" ></td>
	        		</tr>
	        		<tr>
	        			<td align="right"><fmt:message key="i18n.cofimPassword"/>：</td>
	        			<td align="left"><input type="password" id="fp2_cofimPassword" />
	        			
	        			</td>
	        		</tr>
	        		<tr>
	        			<td colspan="2" align="center">
	        			<input type="button" class="l_button rbm110" onclick="fpUpdatePassword1()" value="<fmt:message key="i18n.update"/>">
	        			</td>
	        		</tr>
	        	</table>
        	</form>
           </div>
           
    </div>
</div>
<jsp:include page="bottom.jsp"></jsp:include>
</body>
</html>